dynamics_linkage_dynamics Module

Provides a maximal-coordinate dynamics adapter for serial and parallel linkages. Link mass properties and joint attachment frames are converted into the rigid bodies and holonomic constraints required by the variational integrator.



Contents


Interfaces

public interface linkage_dynamic_model

  • private function ldm_from_serial(mechanism, q) result(rst)

    Constructs a dynamic model from a serial linkage and a compatible set of joint variables. Every serial link is treated as a moving rigid body; the proximal joint of the first link is attached to ground.

    Arguments

    Type IntentOptional Attributes Name
    type(serial_linkage), intent(in) :: mechanism

    The serial linkage to convert.

    real(kind=real64), intent(in), dimension(:) :: q

    One joint variable for each link.

    Return Value type(linkage_dynamic_model)

    The resulting dynamic model.

  • private function ldm_from_parallel(mechanism, q) result(rst)

    Constructs a dynamic model from a parallel or planar linkage. The mechanism's base link remains fixed and all other links become moving maximal-coordinate rigid bodies.

    Arguments

    Type IntentOptional Attributes Name
    class(kinematic_mechanism), intent(in) :: mechanism

    The parallel linkage to convert.

    real(kind=real64), intent(in), dimension(:) :: q

    The complete, constraint-compatible joint-variable array.

    Return Value type(linkage_dynamic_model)

    The resulting dynamic model.


Abstract Interfaces

abstract interface

  • public function linkage_prescribed_motion(t, args) result(rst)

    Computes a prescribed angular displacement as a function of time.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: t

    The simulation time.

    class(*), intent(inout), optional :: args

    A mechanism for passing information in/out of this routine.

    Return Value real(kind=real64)

    The prescribed absolute angle, in radians.


Derived Types

type, public ::  axial_element_result

Defines the instantaneous state and scalar force of an axial element.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: force = 0.0d0

The signed force acting on body 1 toward body 2.

real(kind=real64), public :: length = 0.0d0

The current distance between attachment points.

real(kind=real64), public :: length_rate = 0.0d0

The relative attachment velocity along the element axis.

type, public ::  axial_force_element

Defines an extensible force element between two attachment points. The element force acts along the line from point 1 to point 2. Body index zero denotes a fixed ground point whose coordinates are expressed in world coordinates. Subtypes override evaluate_force to compute a force from the current length and length rate.

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: body_1 = 0

The one-based body index for the first attachment point, or zero for a ground point.

integer(kind=int32), public :: body_2 = 0

The one-based body index for the second attachment point, or zero for a ground point.

real(kind=real64), public, dimension(3) :: point_1 = 0.0d0

The first attachment point in body_1 coordinates, or in world coordinates when body_1 is zero.

real(kind=real64), public, dimension(3) :: point_2 = 0.0d0

The second attachment point in body_2 coordinates, or in world coordinates when body_2 is zero.

Type-Bound Procedures

procedure , public :: evaluate_force => axial_zero_force Function

Returns the signed axial force for a given element length and length rate. The base implementation returns zero.

type, public ::  dynamic_joint

Describes one joint constraint in maximal-coordinate body indexing. Body index zero denotes the fixed ground link. Each frame is a homogeneous transform from its associated body frame to the joint frame; for a ground body, the frame is expressed directly in world coordinates. The parent and child joint frames coincide when the joint constraint is satisfied.

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: child_body = 0

The one-based maximal-coordinate body index on the child side, or zero for the fixed ground link.

real(kind=real64), public, dimension(4,4) :: child_frame

Homogeneous transform locating and orienting the joint frame in the child body frame, or in world coordinates when child_body is zero.

integer(kind=int32), public :: joint_type = REVOLUTE_JOINT

The joint kind, using one of the joint-type constants from dynamics_joints.

integer(kind=int32), public :: parent_body = 0

The one-based maximal-coordinate body index on the parent side, or zero for the fixed ground link.

real(kind=real64), public, dimension(4,4) :: parent_frame

Homogeneous transform locating and orienting the joint frame in the parent body frame, or in world coordinates when parent_body is zero.

type, public ::  joint_reaction

Defines the constraint reaction exerted by a joint on its child link. Both vectors are expressed in the world coordinate frame. The reaction exerted on the parent link is equal and opposite.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public, dimension(3) :: force = 0.0d0

The joint reaction force.

real(kind=real64), public, dimension(3) :: moment = 0.0d0

The joint reaction moment about the joint center.

type, public, extends(axial_force_element) ::  linear_damper

Defines a linear viscous damper acting only along the element axis.

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: body_1 = 0

The one-based body index for the first attachment point, or zero for a ground point.

integer(kind=int32), public :: body_2 = 0

The one-based body index for the second attachment point, or zero for a ground point.

real(kind=real64), public :: damping = 0.0d0

The force per unit axial relative velocity.

real(kind=real64), public, dimension(3) :: point_1 = 0.0d0

The first attachment point in body_1 coordinates, or in world coordinates when body_1 is zero.

real(kind=real64), public, dimension(3) :: point_2 = 0.0d0

The second attachment point in body_2 coordinates, or in world coordinates when body_2 is zero.

Type-Bound Procedures

procedure , public :: evaluate_force => linear_damper_force Function

type, public, extends(axial_force_element) ::  linear_spring

Defines a linear axial spring supporting tension and compression.

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: body_1 = 0

The one-based body index for the first attachment point, or zero for a ground point.

integer(kind=int32), public :: body_2 = 0

The one-based body index for the second attachment point, or zero for a ground point.

real(kind=real64), public :: free_length = 0.0d0

The zero-force element length, including preload definition.

real(kind=real64), public, dimension(3) :: point_1 = 0.0d0

The first attachment point in body_1 coordinates, or in world coordinates when body_1 is zero.

real(kind=real64), public, dimension(3) :: point_2 = 0.0d0

The second attachment point in body_2 coordinates, or in world coordinates when body_2 is zero.

real(kind=real64), public :: stiffness = 0.0d0

The force per unit extension.

Type-Bound Procedures

procedure , public :: evaluate_force => linear_spring_force Function

type, public ::  linkage_dynamic_model

Defines the variational-integrator representation of a linkage. Body index zero in a joint descriptor denotes the fixed ground link.

Constructor

private function ldm_from_serial (mechanism, q)

Constructs a dynamic model from a serial linkage and a compatible set of joint variables. Every serial link is treated as a moving rigid body; the proximal joint of the first link is attached to ground.

private function ldm_from_parallel (mechanism, q)

Constructs a dynamic model from a parallel or planar linkage. The mechanism's base link remains fixed and all other links become moving maximal-coordinate rigid bodies.

Type-Bound Procedures

procedure , public :: add_axial_element => ldm_add_axial_element Subroutine
procedure , public :: add_linear_damper => ldm_add_linear_damper Subroutine
procedure , public :: add_linear_spring => ldm_add_linear_spring Subroutine
procedure , public :: add_torsional_damper => ldm_add_torsional_damper Subroutine
procedure , public :: add_torsional_element => ldm_add_torsional_element Subroutine
procedure , public :: add_torsional_spring => ldm_add_torsional_spring Subroutine
procedure , public :: constraint_residual => ldm_constraint_residual Function
procedure , public :: get_axial_element_count => ldm_get_axial_count Function
procedure , public :: get_axial_element_results => ldm_get_axial_results Function
procedure , public :: get_body_count => ldm_get_body_count Function
procedure , public :: get_constraint_count => ldm_get_constraint_count Function
procedure , public :: get_initial_state => ldm_get_initial_state Function
procedure , public :: get_joint_count => ldm_get_joint_count Function
procedure , public :: get_joint_reactions => ldm_get_joint_reactions Function
procedure , public :: get_torsional_element_count => ldm_get_torsional_count Function
procedure , public :: get_torsional_element_results => ldm_get_torsional_results Function
procedure , public :: solve => ldm_solve Function

type, public, extends(torsional_force_element) ::  torsional_damper

Defines a linear damper opposing only joint-axis twist rate.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: damping = 0.0d0

The torque per unit relative angular velocity.

integer(kind=int32), public :: joint_index = 0

The one-based revolute-joint index whose axis the element uses.

Type-Bound Procedures

procedure , public :: evaluate_torque => torsional_damper_torque Function

type, public ::  torsional_element_result

Defines the instantaneous twist state and torque of a torsional element.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: angle = 0.0d0

The signed joint angle, in radians.

real(kind=real64), public :: angle_rate = 0.0d0

The relative twist rate about the revolute-joint axis.

real(kind=real64), public :: torque = 0.0d0

The signed torque applied to the child body about the joint axis.

type, public ::  torsional_force_element

Defines an extensible torsional element bound to a revolute joint.

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: joint_index = 0

The one-based revolute-joint index whose axis the element uses.

Type-Bound Procedures

procedure , public :: evaluate_torque => torsional_zero_torque Function

type, public, extends(torsional_force_element) ::  torsional_spring

Defines a linear torsional spring about a revolute-joint axis.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: free_angle = 0.0d0

The zero-torque relative joint angle, in radians.

integer(kind=int32), public :: joint_index = 0

The one-based revolute-joint index whose axis the element uses.

real(kind=real64), public :: stiffness = 0.0d0

The torque per unit angular displacement.

Type-Bound Procedures

procedure , public :: evaluate_torque => torsional_spring_torque Function